package com.bbc.commonbackstage.common.mybatisplus.base;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * 基本参数类
 *
 * @author liac
 * @date 2022/4/25 10:00
 */
@Data
public class BaseParam {

    /** 请求参数 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @ApiModelProperty("请求参数")
    @TableField(exist = false)
    protected Map<String, Object> params;

    /** 搜索值 */
    @JsonIgnore
    @TableField(exist = false)
    @ApiModelProperty("搜索值")
    protected String searchValue;

    public Map<String, Object> getParams() {
        if (params == null) {
            params = new HashMap<>();
        }
        return params;
    }

}
